﻿@using ldc_mvc_closing_hwk.Models.Database

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>NewWebsite</title>
    <link rel="stylesheet" href="~/css/index.css">
    <script src="~/js/utils.js"></script>

</head>

<body>
    <!--导航栏-->
    <div class="content">
        <div id="nav">
            <div class="nav_main">
                <a href="/Index.html">全部</a>
                @{
                    var tagList = ViewBag.TagList;
                    foreach (ArticleArea item in tagList)
                    {
                        <a href="/Index_@(item.Id).html"> @item.AreaName </a>
                    }
                }

                <input type="button" value="搜索" id="search" onclick="handleSearch()">
                <input type="text" id="content" placeholder="请输入查找的内容" onKeyDown="if (event.keyCode == 13) handleSearch()">
            </div>
        </div>

        <script>
            window.onload = function () {
                document.getElementById("content").value = getQueryString("keyword") || '';
            }

            function handleSearch() {
                // 获取输入框的值
                let keyword = document.getElementById("content").value;
                let qs = setQueryString("keyword", encodeURIComponent(keyword));
                let loc = window.location;
                if ( loc.pathname.toLowerCase().startsWith("/index") || loc.pathname == "/" ) {
                    loc.search = qs;
                }
                else {
                    loc.href = loc.origin + "/Index.html?" + qs
                }

            }
        </script>

        <div id="main">
            @RenderBody()
        </div>

        @RenderSection("PageNav", false);

        <div class="footer">
            <p>
                <a href="javascript:void(0)">关于NewWebsite</a>
                |
                <a href="javascript:void(0)">诚聘英才</a>
                |
                <a href="javascript:void(0)">商务合作</a>
                |
                <a href="javascript:void(0)">法律声明</a>
                |
                <a href="javascript:void(0)">帮助中心</a>
                |
                <a href="javascript:void(0)">作者投稿</a>
                |
                <a href="javascript:void(0)">联系我们</a>
                |
                <a href="javascript:void(0)">友情链接</a>
            </p>
            <p>
                Copyright©www.newwebsite.com&nbsp;&nbsp;All&nbsp;&nbsp;Rights&nbsp;&nbsp;Reserved&nbsp;版权所有&nbsp;&nbsp;
                <a href="">京ICP备xxxxxxxx-2号</a>
            </p>
            <p>本站所收录新闻来源、社区话题、新闻评论均属其个人学习行为，不代表本站立场。</p>
        </div>
    </div>
    <script>

    </script>
</body>
</html>